package com.trt.beibei.service;

import com.trt.beibei.model.Theme;
import com.trt.beibei.repository.ThemeRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Optional;

/**
 * @author tanrentao
 * @date 2021-08-11
 * @desc
 */
@Service
public class ThemeService {

    @Autowired
    private ThemeRepository themeRepository;

    public List<Theme> findByNames(List<String> nameList) {
        return themeRepository.findByNames(nameList);
    }

    public Optional<Theme> findByNames(String themeName) {
        return themeRepository.findByName(themeName);
    }
}
